package cn.tyz.kotlin.ui

import android.app.Activity
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.util.Log
import android.widget.Toast

/**
 * @author : tyz
 * @ClassName: BaseActivity
 * @Description:
 * @time 2018/5/20 16:16
 */
open class BaseActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        showLog("================"+this.javaClass.simpleName +"  onCreate ================")
    }

    fun Activity.showToast(message: CharSequence, duration: Int = Toast.LENGTH_SHORT) {
        Toast.makeText(this, message, duration).show()
    }

    fun Activity.showLog(message: String) {
        Log.i("BaseActivity",message)
    }
}